home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / PDraw3.0.adf / pdraw_rex.lzh / PointsMove.pdrx < prev    next >
Text File  |  1992-05-17  |  873b  |  53 lines

  1. /*
  2. @N
  3.  
  4. This Genie will move the selected points to a given position
  5. */
  6. call pdm_AutoUpdate(0)
  7. cr = '0a'x
  8. counter = 0
  9.  
  10. do forever
  11.  
  12.     point = pdm_ClickOnPoint("Click on points to be moved..")
  13.     obj        = word(point, 1)
  14.  
  15.     if obj = 0 then 
  16.         break
  17.     else if ~pdm_isbezier(obj) then 
  18.         exit_msg("Object must be made up of bezier")
  19.  
  20.     counter = counter + 1
  21.     objects.counter = point
  22. end
  23.  
  24. if counter = 0 then exit_msg()
  25.  
  26. newpos = pdm_GetClickPosn("Click on new position for first point.")
  27.  
  28. x = word(newpos,1)
  29. y = word(newpos,2)
  30.  
  31. pnt = getpoint(word(objects.1, 1), word(objects.1, 2))
  32. dx = x - word(pnt,1)
  33. dy = y - word(pnt,2)
  34.  
  35. do i = 1 to counter
  36.  
  37.     obj = word(objects.i, 1)
  38.     point = word(objects.i, 2)
  39.     call pdm_MovePoint(obj, point, dx, dy)
  40. end
  41.  
  42.  
  43. exit_msg()
  44.  
  45. exit_msg: procedure
  46. do
  47.     parse arg message
  48.  
  49.     if message ~= '' then call pdm_Inform(1,message,)
  50.     call pdm_AutoUpdate(1)
  51.     exit
  52. end
  53.